#ifndef __ALGORITHM_H
#define __ALGORITHM_H

#define __leetcode_solution__ // leetcode solution function tag

#define ARRAY_LEN(a) ((int)((sizeof(a) / sizeof(a[0]))))

#include <bits/types.h>
#include <stdbool.h>

void array_pos_insert(int *source, int len, int pos, int value);

// leetcode solutions
int __leetcode_solution__ find_repeated_number(int *array, int len);

// sort algorithms
void insert_sort(int *array, int len);
void quick_sort(int *array, int len);
void shell_sort(int *array, int len);
void bubble_sort(int *array, int len);

// search algorithms
int sequential_search(int * array, int target, int len);
int binary_search(int *array, int target, int len);

#endif // __ALGORITHM_H